﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
/// <summary>
/// 环境物体管理器
/// </summary>
public class EnvironmentManager : SingletonProvider<EnvironmentManager>
{
    private string mGroundPath = "Ground";
    private string mSkyPath = "Sky";
    /// <summary>
    /// 创建平面
    /// </summary>
    public void CreateGround(Vector3 pos, UnityAction callback)
    {
        PoolManager.GetInstance().GetObject(mGroundPath, (ground) =>
        {
            ground.transform.position = pos;
            if (callback != null)
                callback.Invoke();
        });
    }
    /// <summary>
    /// 创建天空
    /// </summary>
    /// <param name="pos"></param>
    /// <param name="callback"></param>
    public void CreateSky(Vector3 pos, UnityAction callback)
    {
        PoolManager.GetInstance().GetObject(mSkyPath, (sky) =>
        {
            sky.transform.position = pos;
            if (callback != null)
                callback.Invoke();
        });
    }
}
